import pymysql

connenction = pymysql.connect(host='127.0.0.1',port=3306,user='root',password='000000',db='water',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
try:
    with connenction.cursor() as cursor:
        sql = 'insert into employee(empid,empname) values(5,"liu")'
        cursor.execute(sql)
        connenction.commit()
finally:
    connenction.close()